<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="Bookmark" href="/favicon.ico">
    <link rel="Shortcut Icon" href="/favicon.ico" />
    <title>查看订单详情</title>
    <!--[if lt IE 9]>
<script type="text/javascript" src="lib/html5shiv.js"></script>
<script type="text/javascript" src="lib/respond.min.js"></script>
<![endif]-->
    <link rel="stylesheet" type="text/css" href="../static/h-ui/css/H-ui.min.css" />
    <link rel="stylesheet" type="text/css" href="../static/h-ui.admin/css/H-ui.admin.css" />
    <link rel="stylesheet" type="text/css" href="../lib/Hui-iconfont/1.0.9/iconfont.css" />
    <link rel="stylesheet" type="text/css" href="../static/h-ui.admin/skin/default/skin.css" id="skin" />
    <link rel="stylesheet" type="text/css" href="../static/h-ui.admin/css/style.css" />
    <link rel="stylesheet" href="./../lib/layui/css/layui.css">
    <!--[if IE 6]>
<script type="text/javascript" src="lib/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
</head>

<body>
    <input type="text" name="imgurl" id="imgurl" value="" style="display:block;width:100%;height:50px;display:none;" />
    <div id="box" style="width:100%;display:none;"></div>
    <div class="page-container">

        <form action="" method="post" class="form form-horizontal layui-form" id="form-article-add">
            <div class="row cl">
                <div class="layui-tab " lay-filter="details">
                    <ul class="layui-tab-title">
                        <li class="layui-this">商品信息</li>
                        <li>订单价格信息</li>
                        <li>物流信息</li>
                        <li>支付信息</li>
                    </ul>
                    <div class="layui-tab-content">
                        <div class="layui-tab-item layui-show">
                            <div class="row cl">
                                <div class="formControls col-xs-8 col-sm-9">
                                    <label class="form-label col-xs-4 col-sm-2">商品编号：</label>
                                    <div class="formControls col-xs-8 col-sm-9">
                                        <input type="text" class="input-text" value="" readonly="readonly" placeholder=""
                                            id="no" name="">
                                    </div>
                                </div>
                            </div>
                            <div class="row cl">
                                <div class="formControls col-xs-8 col-sm-9">
                                    <label class="form-label col-xs-4 col-sm-2">商品ID：</label>
                                    <div class="formControls col-xs-8 col-sm-9">
                                        <input type="text" class="input-text" value="" readonly="readonly" placeholder=""
                                            id="shopId" name="">
                                    </div>
                                </div>
                            </div>
                            <div class="row cl">
                                <div class="formControls col-xs-8 col-sm-9">
                                    <label class="form-label col-xs-4 col-sm-2">数量：</label>
                                    <div class="formControls col-xs-8 col-sm-9">
                                        <input type="text" class="input-text" value="" readonly="readonly" placeholder=""
                                            id="num" name="">
                                    </div>
                                </div>
                            </div>
                            <div class="row cl">
                                <div class="formControls col-xs-8 col-sm-9">
                                    <label class="form-label col-xs-4 col-sm-2">单价：</label>
                                    <div class="formControls col-xs-8 col-sm-9">
                                        <input type="text" class="input-text" value="" placeholder="" id="price" name="">
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="layui-tab-item">
                            <div class="row cl">
                                <div class="formControls col-xs-8 col-sm-9">
                                    <label class="form-label col-xs-4 col-sm-2">订单ID：</label>
                                    <div class="formControls col-xs-8 col-sm-9">
                                        <input type="text" class="input-text" value="" readonly="readonly" placeholder=""
                                            id="orderId" name="">
                                    </div>
                                </div>
                            </div>
                            <div class="row cl">
                                <div class="formControls col-xs-8 col-sm-9">
                                    <label class="form-label col-xs-4 col-sm-2">商品折后金额：</label>
                                    <div class="formControls col-xs-8 col-sm-9">
                                        <input type="text" class="input-text" value="" readonly="readonly" placeholder=""
                                            id="amount" name="">
                                    </div>
                                </div>
                            </div>
                            <div class="row cl">
                                <div class="formControls col-xs-8 col-sm-9">
                                    <label class="form-label col-xs-4 col-sm-2">折扣：</label>
                                    <div class="formControls col-xs-8 col-sm-9">
                                        <input type="text" class="input-text" value="" readonly="readonly" placeholder=""
                                            id="discount" name="">
                                    </div>
                                </div>
                            </div>
                            <div class="row cl">
                                <div class="formControls col-xs-8 col-sm-9">
                                    <label class="form-label col-xs-4 col-sm-2">折扣金额：</label>
                                    <div class="formControls col-xs-8 col-sm-9">
                                        <input type="text" class="input-text" value="" readonly="readonly" placeholder=""
                                            id="discountAmount" name="">
                                    </div>
                                </div>
                            </div>

                            <div class="row cl">
                                <div class="formControls col-xs-8 col-sm-9">
                                    <label class="form-label col-xs-4 col-sm-2">邮费：</label>
                                    <div class="formControls col-xs-8 col-sm-9">
                                        <input type="text" class="input-text" value="" readonly="readonly" placeholder=""
                                            id="postFee" name="">
                                    </div>
                                </div>
                            </div>
                            <div class="row cl">
                                <div class="formControls col-xs-8 col-sm-9">
                                    <label class="form-label col-xs-4 col-sm-2">总金额：</label>
                                    <div class="formControls col-xs-8 col-sm-9">
                                        <input type="text" class="input-text" value="" readonly="readonly" placeholder=""
                                            id="total" name="">
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="layui-tab-item">
                            <div class="row cl">
                                <div class="formControls col-xs-8 col-sm-9">
                                    <label class="form-label col-xs-4 col-sm-2">订单编号：</label>
                                    <div class="formControls col-xs-8 col-sm-9">
                                        <input type="text" class="input-text" value="" readonly="readonly" placeholder=""
                                            id="orderNum" name="">
                                    </div>
                                </div>
                            </div>
                            <div class="row cl">
                                <div class="formControls col-xs-8 col-sm-9">
                                    <label class="form-label col-xs-4 col-sm-2">物流单号：</label>
                                    <div class="formControls col-xs-8 col-sm-9">
                                        <input type="text" class="input-text" value="" readonly="readonly" placeholder=""
                                            id="expressNo" name="">
                                    </div>
                                </div>
                            </div>
                            <div class="row cl">
                                <div class="formControls col-xs-8 col-sm-9">
                                    <label class="form-label col-xs-4 col-sm-2">物流名称：</label>
                                    <div class="formControls col-xs-8 col-sm-9">
                                        <input type="text" class="input-text" value="" readonly="readonly" placeholder=""
                                            id="expressName" name="">
                                    </div>
                                </div>
                            </div>
                            <div class="row cl">
                                <div class="formControls col-xs-8 col-sm-9">
                                    <label class="form-label col-xs-4 col-sm-2">物流状态：</label>
                                    <div class="formControls col-xs-8 col-sm-9">
                                        <input type="text" class="input-text" value="" readonly="readonly" placeholder=""
                                            id="expressStatus" name="">
                                    </div>
                                </div>
                            </div>
                            <div class="row cl">
                                <div class="formControls col-xs-8 col-sm-9">
                                    <label class="form-label col-xs-4 col-sm-2">发货时间：</label>
                                    <div class="formControls col-xs-8 col-sm-9">
                                        <input type="text" class="input-text" value="" readonly="readonly" placeholder=""
                                            id="sendTime" name="">
                                    </div>
                                </div>
                            </div>
                            <div class="row cl">
                                <div class="formControls col-xs-8 col-sm-9">
                                    <label class="form-label col-xs-4 col-sm-2">签收时间：</label>
                                    <div class="formControls col-xs-8 col-sm-9">
                                        <input type="text" class="input-text" value="" readonly="readonly" placeholder=""
                                            id="signTime" name="">
                                    </div>
                                </div>
                            </div>
                            <div class="row cl">
                                <div class="formControls col-xs-8 col-sm-9">
                                    <label class="form-label col-xs-4 col-sm-2">备注：</label>
                                    <div class="formControls col-xs-8 col-sm-9">
                                        <input type="text" class="input-text" value="" readonly="readonly" placeholder=""
                                            id="remark" name="">
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="layui-tab-item">
                            <div class="row cl">
                                <div class="formControls col-xs-8 col-sm-9">
                                    <label class="form-label col-xs-4 col-sm-2">订单编号：</label>
                                    <div class="formControls col-xs-8 col-sm-9">
                                        <input type="text" class="input-text" value="" readonly="readonly" placeholder=""
                                            id="orderNo" name="">
                                    </div>
                                </div>
                            </div>
                            <div class="row cl">
                                <div class="formControls col-xs-8 col-sm-9">
                                    <label class="form-label col-xs-4 col-sm-2">交易流水号：</label>
                                    <div class="formControls col-xs-8 col-sm-9">
                                        <input type="text" class="input-text" value="" readonly="readonly" placeholder=""
                                            id="tradeNo" name="">
                                    </div>
                                </div>
                            </div>
                            <div class="row cl">
                                <div class="formControls col-xs-8 col-sm-9">
                                    <label class="form-label col-xs-4 col-sm-2">支付渠道：</label>
                                    <div class="formControls col-xs-8 col-sm-9">
                                        <input type="text" class="input-text" value="" readonly="readonly" placeholder=""
                                            id="payChannel" name="">
                                    </div>
                                </div>
                            </div>
                            <div class="row cl">
                                <div class="formControls col-xs-8 col-sm-9">
                                    <label class="form-label col-xs-4 col-sm-2">支付状态：</label>
                                    <div class="formControls col-xs-8 col-sm-9">
                                        <input type="text" class="input-text" value="" readonly="readonly" placeholder=""
                                            id="status" name="">
                                    </div>
                                </div>
                            </div>
                            <div class="row cl">
                                <div class="formControls col-xs-8 col-sm-9">
                                    <label class="form-label col-xs-4 col-sm-2">订单描述：</label>
                                    <div class="formControls col-xs-8 col-sm-9">
                                        <input type="text" class="input-text" value="" readonly="readonly" placeholder=""
                                            id="orderTit" name="">
                                    </div>
                                </div>
                            </div>
                            <div class="row cl">
                                <div class="formControls col-xs-8 col-sm-9">
                                    <label class="form-label col-xs-4 col-sm-2">总金额(单位：分)：</label>
                                    <div class="formControls col-xs-8 col-sm-9">
                                        <input type="text" class="input-text" value="" readonly="readonly" placeholder=""
                                            id="orderTotal" name="">
                                    </div>
                                </div>
                            </div>
                            <div class="row cl">
                                <div class="formControls col-xs-8 col-sm-9">
                                    <label class="form-label col-xs-4 col-sm-2">备注：</label>
                                    <div class="formControls col-xs-8 col-sm-9">
                                        <input type="text" class="input-text" value="" readonly="readonly" placeholder=""
                                            id="orderRemark" name="">
                                    </div>
                                </div>
                            </div>
                            <div class="row cl">
                                <div class="formControls col-xs-8 col-sm-9">
                                    <label class="form-label col-xs-4 col-sm-2">支付时间：</label>
                                    <div class="formControls col-xs-8 col-sm-9">
                                        <input type="text" class="input-text" value="" readonly="readonly" placeholder=""
                                            id="payTime" name="">
                                    </div>
                                </div>
                            </div>
                            <div class="row cl">
                                <div class="formControls col-xs-8 col-sm-9">
                                    <label class="form-label col-xs-4 col-sm-2">支付完成时间：</label>
                                    <div class="formControls col-xs-8 col-sm-9">
                                        <input type="text" class="input-text" value="" readonly="readonly" placeholder=""
                                            id="completeTime" name="">
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
    </div>

    </form>
    </div>
    <input type="" name="select_vvv" id="select_vvv" value="" style="display:none;" />
    <script src="./../static/jquery.min.js"></script>
    <script type="text/javascript" src="./../static/js/common.js"></script>
    <script type="text/javascript" src="../lib/layer/2.4/layer.js"></script>
    <script type="text/javascript" src="./../lib/layui/layui.js"></script>
    <script>
        var parentId = parent.$("#details_id").val();
        // 获取默认第一个
        $(function () {
            $.ajax({
                type: "post",
                xhrFields: { withCredentials: true },
                url: admin_url + '/kvmOrder/orderProductsInfo',
                data: { tokenUserId: userId, token: token, orderId: parentId },
                success: function (data) {
                    if (data.code == 200 && data.data != null && data.data) {
                        $("#no").val(data.data.orderId)
                        $("#shopId").val(data.data.productId)
                        $("#num").val(data.data.quantity)
                        $("#price").val(data.data.price)
                    }
                }
            })
        })
        layui.use('element', function () {
            var element = layui.element;
            element.on('tab(details)', function (data) {
                if (data.index == 0) {
                    $.ajax({
                        type: "post",
                        xhrFields: { withCredentials: true },
                        url: admin_url + '/kvmOrder/orderProductsInfo',
                        data: { tokenUserId: userId, token: token, orderId: parentId },
                        success: function (data) {
                            console.log(data)
                            if (data.code == 200 && data.data != null && data.data) {
                                $("#no").val(data.data.orderId)
                                $("#shopId").val(data.data.productId)
                                $("#num").val(data.data.quantity)
                                $("#price").val(data.data.price)
                            }
                        }
                    })
                } else if (data.index == 1) {
                    $.ajax({
                        type: "post",
                        xhrFields: { withCredentials: true },
                        url: admin_url + '/kvmOrder/orderPriceInfo',
                        data: { tokenUserId: userId, token: token, orderId: parentId },
                        success: function (data) {
                            console.log(data)
                            if (data.code == 200 && data.data != null && data.data) {
                                $("#orderId").val(data.data.orderId)
                                $("#discount").val(data.data.discount)
                                $("#discountAmount").val(data.data.discountAmount)
                                $("#amount").val(data.data.amount)
                                $("#postFee").val(data.data.postFee)
                                $("#total").val(data.data.total)
                            }
                        }
                    })
                } else if (data.index == 2) {
                    $.ajax({
                        type: "post",
                        xhrFields: { withCredentials: true },
                        url: admin_url + '/kvmOrder/orderExpressInfo',
                        data: { tokenUserId: userId, token: token, orderId: parentId },
                        success: function (data) {
                            console.log(data)
                            if (data.code == 200 && data.data != null && data.data) {
                                $("#orderNum").val(data.data.orderNo)
                                $("#expressNo").val(data.data.expressNo)
                                $("#expressName").val(data.data.expressName)
                                    if (data.data.expressStatus == 6) {
                                        $("#expressStatus").val('待发货')
                                    } else if (data.data.expressStatus == 9) {
                                        $("#expressStatus").val('待收货')
                                    } else if (data.data.expressStatus == 11) {
                                        $("#expressStatus").val('已签收')
                                    } else {
                                        return '<span></span>'
                                    }
                                $("#signTime").val(data.data.signTime)
                                $("#remark").val(data.data.remark)
                                $("#sendTime").val(data.data.sendTime)
                            }
                        }
                    })
                } else if (data.index == 3) {
                    $.ajax({
                        type: "post",
                        xhrFields: { withCredentials: true },
                        url: admin_url + '/kvmOrder/orderPayInfo',
                        data: { tokenUserId: userId, token: token, orderId: parentId },
                        success: function (data) {
                            console.log(data)
                            if (data.code == 200 && data.data != null && data.data) {
                                $("#orderNo").val(data.data.orderNo)
                                $("#tradeNo").val(data.data.tradeNo)
                                if (data.data.payChannel == 0) {
                                    $("#payChannel").val('余额')
                                } else if (data.data.payChannel == 1) {
                                    $("#payChannel").val('微信')
                                } else if (data.data.payChannel == 2) {
                                    $("#payChannel").val('支付宝')
                                }
                                if (data.data.status == 0) {
                                    $("#status").val('待支付');
                                } else if (data.data.status == 2) {
                                    $("#status").val('支付成功');
                                } else if (data.data.status == 4) {
                                    $("#status").val('支付成功');
                                }
                                $("#orderTit").val(data.data.title)
                                $("#orderTotal").val(data.data.total)
                                $("#orderRemark").val(data.data.remark)
                                $("#payTime").val(data.data.payTime)
                                $("#completeTime").val(data.data.completeTime)
                            }
                        }
                    })
                }
            })
            //…
        });
    </script>
</body>

</html>